<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="se" uri="/WEB-INF/serviceTypeTag.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.List"%>
<%@page import="com.doone.telmarket.domain.ServiceProduct"%>
<%@page import="com.doone.telmarket.domain.ServicePage"%>
<%@page import="com.doone.telmarket.domain.ServicePageContent"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="java.math.BigDecimal"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>main</title>
<link rel="stylesheet" rev="stylesheet"
	href="${pageContext.request.contextPath}/css/admin/style-admin.css"
	type="text/css" media="all" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/ckeditor/ckeditor.js"></script>

<script src="${pageContext.request.contextPath}/js/jquery.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/js/jquery.ui.draggable.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.alerts.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ajaxfileupload.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/common.js"
	type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/css/jquery.alerts.css"
	rel="stylesheet" type="text/css" media="screen" />

<style type="text/css">
<!--
.atten {
	font-size: 12px;
	font-weight: normal;
	color: #F00;
}
-->
</style>
</head>

<body class="ContentBody">
<div style="z-index: 1;height: 1000">

<div class="MainDiv"><input type="hidden" id="contextPath" value="${pageContext.request.contextPath}">
<table width="99%" border="0" cellpadding="0" cellspacing="0"
	class="CContent">
	<tr>
		<th class="tablestyle_title">增值业务管理</th>
	</tr>
	<tr>
		<td class="CPanel">
		<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
			<tr>
				<td align="left"><a
					href="service.jsp">新增增值业务</a> <a href="toOperationService.jsp">编辑增值业务</a>

				</td>
			</tr>

			<tr align="center">
				<td class="TablePanel"></td>
			</tr>
			<tr>
				<TD width="100%">
				<div >
					<fieldset style="height: 100%;"><legend>增值业务产品类别管理</legend>
					<form action="" id="proForm" name="proForm">
					<table border="0" cellpadding="2" cellspacing="1"
						style="width: 100%">
						
						<tr>
							<td nowrap align="right" width="13%">类别代码：</td>
							<td width="32%"><input type="text" maxlength="30" 
								 id="productId" /><span style="color:black">*　 请输入数字类型的类别代码</span></td>
						</tr>
						<tr>
							<td nowrap align="right" width="13%">类别名称:</td>
							<td width="32%">
								<input type="text" id="productName">
							</td>
					　　</tr>
					    <tr>
							<td nowrap align="right" width="13%">支持终端机型:</td>
							<td width="32%">
								<input type="text" id="productDesc" size="30">
							</td>
					　　</tr>
					    <tr>
							<td nowrap align="right" width="13%">产品资费:</td>
							<td width="32%">
								<input type="text" id="productFee">元/月
							</td>
					　　</tr>
						<tr>
							<td nowrap align="right" width="13%">增值编码类别:</td>
							<td width="32%"><select name="serviceCodeType" id="serviceCodeType">
								<option value="P">产品类型</option>
								<option value="C">套餐类型</option>
							</select></td>
						</tr>
						<tr>
								<td colspan="2" align="center" height="50px"><input type="button" id="proSub" onclick="subPro();"
									value="保存" class="button"　/><input type="button" name="Submit2" id="proCancel"
									value="完成" class="button" onclick="forwardPage('${pageContext.request.contextPath}/admin/success.jsp');"/>
									<input type="button" name="Submit2" 
									value="清空缓存" class="button" onclick="cancelOprationService();"/>
								</td>
						</tr>
					</table>
					</form>
					</fieldset>
				
				</div>
				
				<div >
					<fieldset style="height: 100%;"><legend>已增加增值业务类别</legend>
						<table width="730" border="1px" id="productTable">
							  <tr>
							    <td width="150">类别代码</td>
							    <td width="150">类别名称</td>
							    <td width="150">支持终端</td>
							    <td width="100">产品资费</td>
							    <td width="150">增值编码类别</td>
							    <td width="50">操作</td>
							  </tr>
							  <%
							  	if(session.getAttribute("servicePage")!=null){
							  		 List<ServiceProduct> sp = ((ServicePage)session.getAttribute("servicePage"))
							  		 				.getService().getProducts();
							  		 for(int i=0;i<sp.size();i++){
							  			 String type = "套餐类型";
							  			 if(sp.get(i).getProductType().toString().equals("P")){
							  				type =  "产品类型";
							  			 }
							  			 %>  
							  			 
							  	<tr>
							    <td width="150"><%=sp.get(i).getProductId() %></td>
							    <td width="150"><%=sp.get(i).getProductName() %></td>
							    <td width="150"><%=sp.get(i).getProductSummary() %></td>
							    <td width="100"><%=sp.get(i).getCost().divide(new BigDecimal(100)) %></td>
							    <td width="150"><%=type %></td>
							    <td width="50"><input type='button' onclick="delProduct('<%=sp.get(i).getProductId() %>',this);" value=删除 class='button' /></td>
							   </tr>		 
							  			 <%
							  		 }
							  	}
							   
							  %>
					</table>
					</fieldset>
				
				</div>
				</TD>
			</TR>
		</TABLE>
		</td>
	</tr>
	
	
</TABLE>
</div>

</div>



<form action="cancelOprationService" method="post" id="cancelForm"></form>
</body>
</html>